package com.house365.core.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class ResizeLayout extends LinearLayout{
	private OnResizeListener mListener;   
	public interface OnResizeListener {
		  void OnResize(int w, int h, int oldw, int oldh);   
	}
	 
	public void setOnResizeListener(OnResizeListener mListener) {
		this.mListener = mListener;
	}

	public ResizeLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		// TODO Auto-generated method stub
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	} 
	@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		// TODO Auto-generated method stub
		super.onSizeChanged(w, h, oldw, oldh);
		if(mListener!=null){
			mListener.OnResize(w, h, oldw, oldh);
		}
	}
	

}
